package com.tbb.app.base.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.tbb.app.base.entity.UserNote;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.util.Date;

@Data
@Accessors(chain = true)
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(description = "评论VO")
public class RemarkVO {

    @ApiModelProperty("id")
    private String id;

    @ApiModelProperty("发布时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    @ApiModelProperty("评论内容")
    private String remark;

    @ApiModelProperty("评论人id")
    private String userId;

    @ApiModelProperty("评论人昵称")
    private String userName;

    @ApiModelProperty("评论人账号")
    private String userAccount;

    @ApiModelProperty("评论人头像")
    private String userImg;

    public RemarkVO(UserNote un) {
        this.id = un.getId();
        this.createTime = un.getCreateTime();
        this.remark = un.getRemark();
        this.userId = un.getUserId();
    }
}
